/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:
 * Date: 2024-07-22
 * Time: 16:29
 */

/*
class Array{
    public Object[] array = new Object[10];

    public Object gerPos(int pos){
        return this.array[pos];
    }
    public void setVal(int pos,Object val){
        this.array[pos] = val;
    }
}


public class Test {
    public static void main(String[] args) {
        Array array = new Array();
        array.setVal(0,10);
        array.setVal(1,"string");
        String ret = (String)array.gerPos(1);
        System.out.println(ret);
    }

    public static void main1(String[] args) {
        int i = 10;
        Integer ii =Integer.valueOf(i);
        Integer ij = i;
        Integer ik = 10;
    }
}
*/
class MyArray<T>{
    public Object[] array = new Object[10];

    public T getPos(int pos){
        return (T)this.array[pos];
    }

    public void setArray(int pos, T val){
        this.array[pos] = val;
    }
}

public class Test {
    public static void main(String[] args) {
        MyArray<Integer>myArray = new MyArray<>();
        myArray.setArray(0,1);
        myArray.setArray(1,1);

        MyArray<String>myArray1 = new MyArray<>();
        myArray1.setArray(0,"hus");
        myArray1.setArray(1,"dsffwe");
    }
}